namespace JGSY.CMS.LowCode.Platform.Infrastructure.Configuration
{
    /// <summary>
    /// 云存储配置
    /// </summary>
    public class CloudStorageConfiguration
    {
        /// <summary>
        /// 阿里云OSS配置
        /// </summary>
        public AliyunOssConfiguration AliyunOss { get; set; } = new();

        /// <summary>
        /// 腾讯云COS配置
        /// </summary>
        public TencentCosConfiguration TencentCos { get; set; } = new();

        /// <summary>
        /// 华为云OBS配置
        /// </summary>
        public HuaweiObsConfiguration HuaweiObs { get; set; } = new();

        /// <summary>
        /// 本地存储配置
        /// </summary>
        public LocalStorageConfiguration Local { get; set; } = new();
    }

    /// <summary>
    /// 阿里云OSS配置
    /// </summary>
    public class AliyunOssConfiguration
    {
        /// <summary>
        /// 端点
        /// </summary>
        public string Endpoint { get; set; } = string.Empty;

        /// <summary>
        /// 访问密钥ID
        /// </summary>
        public string AccessKeyId { get; set; } = string.Empty;

        /// <summary>
        /// 访问密钥密码
        /// </summary>
        public string AccessKeySecret { get; set; } = string.Empty;

        /// <summary>
        /// 存储桶名称
        /// </summary>
        public string BucketName { get; set; } = string.Empty;

        /// <summary>
        /// 基础URL
        /// </summary>
        public string? BaseUrl { get; set; }

        /// <summary>
        /// 是否启用
        /// </summary>
        public bool Enabled { get; set; } = false;
    }

    /// <summary>
    /// 腾讯云COS配置
    /// </summary>
    public class TencentCosConfiguration
    {
        /// <summary>
        /// 应用ID
        /// </summary>
        public string AppId { get; set; } = string.Empty;

        /// <summary>
        /// 地域
        /// </summary>
        public string Region { get; set; } = string.Empty;

        /// <summary>
        /// 访问密钥ID
        /// </summary>
        public string SecretId { get; set; } = string.Empty;

        /// <summary>
        /// 访问密钥密码
        /// </summary>
        public string SecretKey { get; set; } = string.Empty;

        /// <summary>
        /// 存储桶名称
        /// </summary>
        public string BucketName { get; set; } = string.Empty;

        /// <summary>
        /// 基础URL
        /// </summary>
        public string? BaseUrl { get; set; }

        /// <summary>
        /// 是否启用
        /// </summary>
        public bool Enabled { get; set; } = false;
    }

    /// <summary>
    /// 华为云OBS配置
    /// </summary>
    public class HuaweiObsConfiguration
    {
        /// <summary>
        /// 端点
        /// </summary>
        public string Endpoint { get; set; } = string.Empty;

        /// <summary>
        /// 访问密钥ID
        /// </summary>
        public string AccessKeyId { get; set; } = string.Empty;

        /// <summary>
        /// 访问密钥密码
        /// </summary>
        public string SecretAccessKey { get; set; } = string.Empty;

        /// <summary>
        /// 存储桶名称
        /// </summary>
        public string BucketName { get; set; } = string.Empty;

        /// <summary>
        /// 基础URL
        /// </summary>
        public string? BaseUrl { get; set; }

        /// <summary>
        /// 是否启用
        /// </summary>
        public bool Enabled { get; set; } = false;
    }

    /// <summary>
    /// 本地存储增强配置
    /// </summary>
    public class LocalStorageConfiguration
    {
        /// <summary>
        /// 根目录路径
        /// </summary>
        public string RootPath { get; set; } = "wwwroot/uploads";

        /// <summary>
        /// 基础URL
        /// </summary>
        public string BaseUrl { get; set; } = "/uploads";

        /// <summary>
        /// 是否启用
        /// </summary>
        public bool Enabled { get; set; } = true;

        /// <summary>
        /// 是否创建日期子目录
        /// </summary>
        public bool CreateDateFolders { get; set; } = true;

        /// <summary>
        /// 是否生成缩略图
        /// </summary>
        public bool GenerateThumbnails { get; set; } = true;

        /// <summary>
        /// 缩略图尺寸
        /// </summary>
        public ThumbnailSize ThumbnailSize { get; set; } = new();
    }

    /// <summary>
    /// 缩略图尺寸配置
    /// </summary>
    public class ThumbnailSize
    {
        public int Width { get; set; } = 200;
        public int Height { get; set; } = 200;
        public string Quality { get; set; } = "High"; // Low, Medium, High
    }
}
